package com.atguigu.day20.syn01.s2;

//todo 张三线程
public class ZsThread extends Thread{
    Account account ;
    @Override
    public void run() {
        //1.校验余额
        if(account.money>=1500){
            //2.满足 取钱
            account.withDraw(1500);
            System.out.println(this.getName()+"取钱成功,余额是"+account.money+"元");
        }else{
            //3.不满足 提示信息 余额不足
            System.out.println(this.getName()+"取钱失败 余额不足,余额是"+account.money+"元");
        }
    }
}
